import { Module } from '@nestjs/common';
import { UserService } from './user.service';
import { UserController } from './user.controller';
//模块文件中注册userscheme
import { MongooseModule } from '@nestjs/mongoose';
import { UserSchema,User } from 'src/mongoScheme/user.schema';
import { AuthModule } from 'src/auth/auth.module';
import { AuthGuard } from 'src/auth/auth.guard';
import { Subscribe, SubscribeSchema } from 'src/mongoScheme/subscribe.schema';
@Module({
  imports: [
    AuthModule,
    MongooseModule.forFeature([{ name: User.name, schema: UserSchema },{name:Subscribe.name,schema:SubscribeSchema}]),
  ],
  controllers: [UserController],
  providers: [
    UserService,
    {
      provide:'APP_GUARD',
      useClass:AuthGuard
    }
  ],
  exports:[UserService]
})
export class UserModule {}
